BaseView
This is the base view responsible for mixing in functions for focus management, key handling and providing the main framework. It light enough for use as a component; but not recommended for use in RowLists, Grids and other aggregate views which are expected to have a large amount of view items.
This view is intended to be extended by Components, which in turn are aggregates of views; but not whole screens.
BaseView fields
isInitialized- indicates ifinitializehas yet been calledisShown, true if the view is on screenname, useful for loggingstate, contains the state of the current viewnone|initialized|destroyed
BaseView methods
initialize- must be called to start the view machinery
BaseView abstract methods
You can override these methods to safely drive your application behavior
applyStyle(styles, localizations, assets)- will be called when the view is initialized, so it can apply required styles, etcinitialize(args)- called when the view has been initializedonFirstShow- called the first time a view is shownonShow- called when a view is shown- Note that a view cannot be shown if it is not initialized. This method will be called immediately for a visible view, when
initializeis invoked
- Note that a view cannot be shown if it is not initialized. This method will be called immediately for a visible view, when
onHide- called when a view is hidden
In addition you can override the methods in KeyMixin:
-
isAnyKeyPressLocked()- returns true if any key press is locked - the default implementation returns the value ofm.isKeyPressLocked -
isCapturingAnyKeyPress(key), return true if the keykeyis captured
Override the following, to return true, if the applicable key is captured
-
onKeyPressDown() -
onKeyPressUp() -
onKeyPressLeft() -
onKeyPressRight() -
onKeyPressBack() -
onKeyPressOption() -
onKeyPressOK()
Also, BaseView allows entry points for overriding abstract methods from FocusMixin
onGainedFocus(isSelfFocused)onLostFocus()